package jp.co.toshiba.ffsa.form.cses;

import jp.co.toshiba.ffsa.form.BaseForm;

import org.seasar.struts.annotation.Arg;
import org.seasar.struts.annotation.Mask;
import org.seasar.struts.annotation.Maxlength;
import org.seasar.struts.annotation.Msg;
import org.seasar.struts.annotation.Required;

/**
 * 簡易(通常入力)フォーム
 * @author npc
 */
public class Cses102Form extends BaseForm {
    /** Logic size */
    @Required(msg=@Msg(key="errors.required", resource=true), arg0=@Arg(key="logic_size_kind", resource=true))
    public String logicSizeKind;

    /** Logic size */
    @Required(msg=@Msg(key="errors.required", resource=true), arg0=@Arg(key="logic_size", resource=true))
    @Maxlength(maxlength=10, msg=@Msg(key="errors.maxlength", resource=true), arg0=@Arg(key="logic_size", resource=true), arg1=@Arg(key="10", resource=false))
    @Mask(mask="^[0-9]+$", msg=@Msg(key="errors.numeric", resource=true), arg0=@Arg(key="logic_size", resource=true))
    public String logicSize;

    /** SRAM size */
    @Required(msg=@Msg(key="errors.required", resource=true), arg0=@Arg(key="sram_size", resource=true))
    @Maxlength(maxlength=10, msg=@Msg(key="errors.maxlength", resource=true), arg0=@Arg(key="sram_size", resource=true), arg1=@Arg(key="10", resource=false))
    @Mask(mask="^[0-9]+$", msg=@Msg(key="errors.numeric", resource=true), arg0=@Arg(key="sram_size", resource=true))
    public String sramSize;

    /** I/O count */
    @Required(msg=@Msg(key="errors.required", resource=true), arg0=@Arg(key="io_count", resource=true))
    @Maxlength(maxlength=10, msg=@Msg(key="errors.maxlength", resource=true), arg0=@Arg(key="io_count", resource=true), arg1=@Arg(key="10", resource=false))
    @Mask(mask="^[0-9]+$", msg=@Msg(key="errors.numeric", resource=true), arg0=@Arg(key="io_count", resource=true))
    public String ioCount;

    /** Serdes 有無 */
    @Required(msg=@Msg(key="errors.required", resource=true), arg0=@Arg(key="serdes_flag", resource=true))
    public String serdesFlag;

    /** Serdes count */
    @Required(msg=@Msg(key="errors.required", resource=true), arg0=@Arg(key="serdes_count", resource=true))
    @Maxlength(maxlength=10, msg=@Msg(key="errors.maxlength", resource=true), arg0=@Arg(key="serdes_count", resource=true), arg1=@Arg(key="10", resource=false))
    @Mask(mask="^[0-9]+$", msg=@Msg(key="errors.numeric", resource=true), arg0=@Arg(key="serdes_count", resource=true))
    public String serdesCount;

    /** 要求周波数 */
    @Maxlength(maxlength=20, msg=@Msg(key="errors.maxlength", resource=true), arg0=@Arg(key="frequency_requirement", resource=true), arg1=@Arg(key="20", resource=false))
    @Mask(mask="^[0-9a-zA-Z]+$", msg=@Msg(key="errors.emcharacter", resource=true), arg0=@Arg(key="frequency_requirement", resource=true))
    public String frequencyRequirement;

    /** パッケージ */
    @Required(msg=@Msg(key="errors.required", resource=true), arg0=@Arg(key="pkg_type", resource=true))
    public String pkgType;

    /** 数量 */
    @Required(msg=@Msg(key="errors.required", resource=true), arg0=@Arg(key="quantity", resource=true))
    public String quantity;

    /** 用途 */
    @Maxlength(maxlength=200, msg=@Msg(key="errors.maxlength", resource=true), arg0=@Arg(key="use_for", resource=true), arg1=@Arg(key="200", resource=false))
    @Mask(mask="^[0-9a-zA-Z \r\n]+$", msg=@Msg(key="errors.emcharacter", resource=true), arg0=@Arg(key="use_for", resource=true))
    public String useFor;

    /** 開発スケジュール */
    @Maxlength(maxlength=200, msg=@Msg(key="errors.maxlength", resource=true), arg0=@Arg(key="development_schedule", resource=true), arg1=@Arg(key="200", resource=false))
    @Mask(mask="^[0-9a-zA-Z \r\n]+$", msg=@Msg(key="errors.emcharacter", resource=true), arg0=@Arg(key="development_schedule", resource=true))
    public String developmentSchedule;

    /** ターゲット開発費 */
    @Maxlength(maxlength=10, msg=@Msg(key="errors.maxlength", resource=true), arg0=@Arg(key="target_nre", resource=true), arg1=@Arg(key="10", resource=false))
    @Mask(mask="^[0-9]+$", msg=@Msg(key="errors.numeric", resource=true), arg0=@Arg(key="target_nre", resource=true))
    public String targetNre;

    /** ターゲット単価 */
    @Maxlength(maxlength=10, msg=@Msg(key="errors.maxlength", resource=true), arg0=@Arg(key="target_price", resource=true), arg1=@Arg(key="10", resource=false))
    @Mask(mask="^[0-9]+$", msg=@Msg(key="errors.numeric", resource=true), arg0=@Arg(key="target_price", resource=true))
    public String targetPrice;

    /** 要求IP情報 */
    @Maxlength(maxlength=200, msg=@Msg(key="errors.maxlength", resource=true), arg0=@Arg(key="ip", resource=true), arg1=@Arg(key="200", resource=false))
    @Mask(mask="^[0-9a-zA-Z \r\n]+$", msg=@Msg(key="errors.emcharacter", resource=true), arg0=@Arg(key="ip", resource=true))
    public String ip;

    /**
     * 初期化処理
     */
    public void reset(){
        this.logicSizeKind        = "";
        this.logicSize            = "";
        this.sramSize             = "";
        this.ioCount              = "";
        this.serdesFlag           = "";
        this.serdesCount          = "";
        this.frequencyRequirement = "";
        this.pkgType              = "";
        this.quantity             = "";
        this.useFor               = "";
        this.developmentSchedule  = "";
        this.targetNre            = "";
        this.targetPrice          = "";
        this.ip                   = "";
    }
}